{extend name="default/base" /}
{block name="main"}
<div class='wst-toolbar'>
    <input type='text' class="s-ipt" id='orderNo' placeholder='订单号' />
    <a class="btn btn-primary" onclick="queryByPage()"><i class="fa fa-search"></i>查询</a>
</div>
<style>
.gImg{width: 50px; height: 50px; margin: 5px;}
.os-tc{text-align: center;}
.j-order-row td{text-align: center;}
</style>
<div class='wst-grid'>
    <table class='wst-order-list'>
        <thead>
            <tr class='head'>
                <th width="155" class="th-padding os-tc">订单编号</th>
                <th class="os-tc">售后商品</th>
                <th width="210" class="os-tc">售后类型</th>
                <th width="210" class="os-tc">状态</th>
                <th width="210" class="os-tc">操作</th>
            </tr>
        </thead>
        <tbody id='loadingBdy'>
            <tr id='loading' class='empty-row' style='display:none'>
                <td colspan='4'><img src="__SHOP__/img/loading.gif">正在加载数据...</td>
            </tr>
        </tbody>
        <script id="tblist" type="text/html">
       {{# for(var i = 0; i < d.length; i++){ }}
       <tbody class="j-order-row">
            <tr>
                <td>{{ d[i].orderNo }}</td>
                <td>
                    {{# 
                        var imgCode = d[i].gImgs.map(function(item){
                            return "<img data-original='__RESOURCE_PATH__/"+item+"' class='gImg'>"
                        });
                        imgCode = imgCode.join('')
                    }}
                    {{ imgCode }}
                </td>
                <td>
                    {{# 
                        var type = "";
                        switch(d[i].goodsServiceType){
                            case 0:
                                type = "退货退款";
                            break;
                            case 1:
                                type = "仅退款";
                            break;
                            case 2:
                                type = "仅换货";
                            break;
                        }
                    }}
                    {{ type }}
                </td>
                <td>
                    {{ d[i].statusText }}
                </td>
                <td>
                    {{# 
                        var props = {id:d[i].id};
                        var dealUrl = WST.U('shop/orderservices/deal',props);
                    }}
                    <a href="{{ dealUrl }}">【详情】</a>
                </td>
            </tr>
       </tbody>
       {{# }  }}
       </script>
        <tr class='empty-row' style="border: 0px;">
            <td colspan='4' id='pager' align="center" style='padding:5px 0px 5px 0px'>&nbsp;</td>
        </tr>
    </table>
</div>
{/block}
{block name="js"}
<script type="text/javascript" src="__STATIC__/js/jquery.min.js?v={$v}"></script>
<script type="text/javascript" src="__STATIC__/plugins/layer/layer.js?v={$v}"></script>
<script type='text/javascript' src='__ROOT__/static/plugins/lazyload/jquery.lazyload.min.js?v={$v}'></script>
<script type='text/javascript' src='__SHOP__/orderservices/orderservices.js?v={$v}'></script>
<script>
    $(function () {
        queryByPage({$p});
    })
</script>
{/block}